package jdk.thread.lock;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class ReentrantReadWriteLockTest {

    public static void main(String[] args) {
        ReadWriteLock lock = new ReentrantReadWriteLock();

        Lock readLock = lock.readLock();
        readLock.lock(); readLock.unlock();

        Lock writeLock = lock.writeLock();
        writeLock.lock(); writeLock.unlock();
    }
}
